<?php
class Usuario extends ActiveRecord{
    
    public function initialize()
    {
        $this->belongs_to('rol');
        
  

       //validaciones de que los campos no esten vacios
        $this->belongs_to('bodega');
        $this->validates_presence_of("nombre");
        $this->validates_presence_of("apellidos");
        $this->validates_presence_of("rut");
        $this->validates_presence_of("telefono");
        $this->validates_presence_of("email");
        $this->validates_presence_of("username");
        $this->validates_presence_of("contraseña");
        $this->validates_presence_of("estado");
        $this->validates_presence_of("bodega_id");
        $this->validates_presence_of("rol");
        
  $this->validates_email_in("email");
        
        
 
     
    }
   
   
}
?>